import request from '@/utils/request'

// 查询订单设备信息，一个订单多个设备列表
export function listDevice(query) {
  return request({
    url: '/order/device/list',
    method: 'get',
    params: query
  })
}

// 查询订单设备信息，一个订单多个设备详细
export function getDevice(id) {
  return request({
    url: '/order/device/' + id,
    method: 'get'
  })
}

// 新增订单设备信息，一个订单多个设备
export function addDevice(data) {
  return request({
    url: '/order/device',
    method: 'post',
    data: data
  })
}

// 修改订单设备信息，一个订单多个设备
export function updateDevice(data) {
  return request({
    url: '/order/device',
    method: 'put',
    data: data
  })
}

export function finishDevice(id){
  return request({
    url: '/order/device/finish/'+id,
    method: 'put'
  })
}

export function saveColumnSetting(data) {
  return request({
    url: '/order/device/setting',
    method: 'put',
    data: data
  })
}

// 设备绑定看板
export function bindingKanbanBatch(data) {
  return request({
    url: '/order/device/binding/kanban/batch',
    method: 'put',
    data: data
  })
}

export function unbindingKanban(deviceId, kanbanName) {
  return request({
    url: '/order/device/' + deviceId + '/unbinding/kanban/' + kanbanName,
    method: 'put'
  })
}

// 删除订单设备信息，一个订单多个设备
export function delDevice(id) {
  return request({
    url: '/order/device/' + id,
    method: 'delete'
  })
}

// 导出订单设备信息，一个订单多个设备
export function exportDevice(query) {
  return request({
    url: '/order/device/export',
    method: 'get',
    params: query
  })
}
